package com.taobao.modules.mytest;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class NetUtile {

	public static void getIPaddress() throws UnknownHostException {
		InetAddress inet = InetAddress.getLocalHost();
		System.out.println("HostAddress=" + inet.getHostAddress());
		System.out.println("HostName=" + inet.getHostName());
		System.out.println("CanonicalHostName=" + inet.getCanonicalHostName());
		System.out.println("LocalHost=" + inet.getLocalHost());
	}
	/**
	 * @param args
	 * @throws UnknownHostException
	 */
	public static void main(String[] args) throws UnknownHostException {
		// TODO Auto-generated method stub
		NetUtile.getIPaddress();
	}
}
